|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<Request>
com.facebook.RequestBatch
public class RequestBatch
RequestBatch contains a list of Request objects that can be sent to Facebook in a single round-trip.
| Nested Class Summary | |
|---|---|
static interface |
RequestBatch.Callback
Specifies the interface that consumers of the RequestBatch class can implement in order to be notified when the entire batch completes execution. |
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
RequestBatch()
Constructor. |
|
RequestBatch(Collection<Request> requests)
Constructor. |
|
RequestBatch(Request... requests)
Constructor. |
|
RequestBatch(RequestBatch requests)
Constructor. |
|
| Method Summary | |
|---|---|
void |
add(int location,
Request request)
|
boolean |
add(Request request)
|
void |
addCallback(RequestBatch.Callback callback)
Adds a batch-level callback which will be called when the entire batch has finished executing. |
void |
clear()
|
List<Response> |
executeAndWait()
Executes this batch on the current thread and returns the responses. |
RequestAsyncTask |
executeAsync()
Executes this batch asynchronously. |
Request |
get(int i)
|
int |
getTimeout()
Gets the timeout to wait for responses from the server before a timeout error occurs. |
Request |
remove(int location)
|
void |
removeCallback(RequestBatch.Callback callback)
Removes a batch-level callback. |
Request |
set(int location,
Request request)
|
void |
setTimeout(int timeoutInMilliseconds)
Sets the timeout to wait for responses from the server before a timeout error occurs. |
int |
size()
|
| Methods inherited from class java.util.AbstractList |
|---|
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public RequestBatch()
public RequestBatch(Collection<Request> requests)
requests - the requests to add to the batchpublic RequestBatch(Request... requests)
requests - the requests to add to the batchpublic RequestBatch(RequestBatch requests)
requests - the requests to add to the batch| Method Detail |
|---|
public int getTimeout()
public void setTimeout(int timeoutInMilliseconds)
timeoutInMilliseconds - the timeout, in milliseconds; 0 means do not timeoutpublic void addCallback(RequestBatch.Callback callback)
callback - the callbackpublic void removeCallback(RequestBatch.Callback callback)
callback - the callbackpublic final boolean add(Request request)
add in interface Collection<Request>add in interface List<Request>add in class AbstractList<Request>
public final void add(int location,
Request request)
add in interface List<Request>add in class AbstractList<Request>public final void clear()
clear in interface Collection<Request>clear in interface List<Request>clear in class AbstractList<Request>public final Request get(int i)
get in interface List<Request>get in class AbstractList<Request>public final Request remove(int location)
remove in interface List<Request>remove in class AbstractList<Request>
public final Request set(int location,
Request request)
set in interface List<Request>set in class AbstractList<Request>public final int size()
size in interface Collection<Request>size in interface List<Request>size in class AbstractCollection<Request>public final List<Response> executeAndWait()
FacebookException - If there was an error in the protocol used to communicate with the service
IllegalArgumentException - if the passed in RequestBatch is empty
NullPointerException - if the passed in RequestBatch or any of its contents are nullpublic final RequestAsyncTask executeAsync()
Request.setCallback(com.facebook.Request.Callback))
This should only be called from the UI thread.
IllegalArgumentException - if this batch is empty
NullPointerException - if any of the contents of this batch are null
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||